﻿@model WebUI.Models.UserMemo
@*@using (Ajax.BeginForm(null,new{IsView=false},new AjaxOptions()
{
    LoadingElementId = "OnLoadingSpan",
    UpdateTargetId = "dialogbox",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "Post",
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}, new { enctype = "multipart/form-data" }))*@
@using (Html.BeginForm(null, null, new { IsView = false }, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>健康备忘录</legend>
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.CreateTime)
        @Html.HiddenFor(model => model.UserID)
        <table width="100%">
            <tr>
                <td>
                    @Html.EditorFor(model => model.Title, "TxtField")
                    @Html.EditorFor(model => model.Timemark, "TxtField")
                    @Html.EditorFor(model => model.Recuper.EnHospDay, "TxtField")
                    @Html.EditorFor(model => model.MemoText, "LongTxtField")
                   @* @Html.Hidden("memopicfile" + ".keep", Model.MemoPic)*@
@*                    <input name="memopicfile" type="file" onchange="fileInputCheck(this,0.8);" />*@
                </td>
                <td>
                    @if (!string.IsNullOrEmpty(Model.MemoPic))
                    {
                        var exts = new string[] { ".png", ".jpg", ".jpeg", ".gif" };
                        var ext = System.IO.Path.GetExtension(Model.MemoPic).ToLower();

                        if (exts.Contains(ext))
                        {
                        <a class="imagefield-view" target="_blank" href="@(Url.Action("Img", "Recuper", new { ID = Model.MemoPic, _newpage = "true" }))">
                            <img alt="照片" src="@(Url.Action("Img", "Recuper", new { ID = Model.MemoPic, Preview = true }))" />
                        </a>
                        }
                    }
                </td>
            </tr>
        </table>
@*        <p>
            @Helpers.SubmitButton("保存")
        </p>*@
    </fieldset>
}
<script type="text/javascript">
    $(function () {
        $("input,select,textarea").prop("readonly",true);
    });
</script>